package com.javandad.app.shared.entity;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "false")
public class Membership implements java.io.Serializable{

	private static final long serialVersionUID = -4191421842247597315L;
	@SuppressWarnings("unused")
	private Membership(){
	}
	
	public Membership(User member, String userGroup, Date dateOfMembership) {
		super();
		this.member = member;
		this.userGroup = userGroup;
		this.dateOfMembership = dateOfMembership;
	}

	public User getMember() {
		return member;
	}

	public String getUserGroup() {
		return userGroup;
	}

	public void setDateOfMembership(Date dateOfMembership) {
		this.dateOfMembership = dateOfMembership;
	}

	public Date getDateOfMembership() {
		return dateOfMembership;
	}

	public long getId() {
		return id;
	}
	
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long id;	
	
	@Persistent
	private User member;
	@Persistent
	private String userGroup;
	@Persistent
	private Date dateOfMembership;

}
